//
//  ZYTableViewCell.m
//  MusicMV
//
//  Created by dllo on 16/3/22.
//  Copyright © 2016年 Eternity. All rights reserved.
//

#import "ZYTableViewCell.h"

@implementation ZYTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self table];
    }
    return self;
}

- (void)dealloc {
    
}

- (void)table {
    
    self.imgeView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgeView];
    
    self.fLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_fLabel];
    
    self.sLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_sLabel];
    
    self.tLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_tLabel];
    
}

- (void)setLmodel:(ZYLModel *)lmodel {
    _lmodel = lmodel;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    _imgeView.frame = CGRectMake(0, 0, SCREEN_WIDTH / 4.5, SCREEN_HEIGHT / 8);
    _imgeView.backgroundColor = [UIColor clearColor];
    [_imgeView SDWEBIMAGE(_lmodel.coverPath)];
    
    _fLabel.frame = CGRectMake(SCREEN_WIDTH / 8 + 40, 0, SCREEN_WIDTH / 2.5, SCREEN_HEIGHT / 20);
    _fLabel.backgroundColor = [UIColor clearColor];
    _fLabel.text = _lmodel.title;
    
    _sLabel.frame = CGRectMake(SCREEN_WIDTH / 8 + 40, SCREEN_HEIGHT / 20, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 30);
    _sLabel.font = [UIFont systemFontOfSize:13];
    _sLabel.backgroundColor = [UIColor clearColor];
    
    
    _tLabel.frame = CGRectMake(SCREEN_WIDTH / 8 + 40, SCREEN_HEIGHT / 11, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 30);
    _tLabel.font = [UIFont systemFontOfSize:13];
    _tLabel.backgroundColor = [UIColor clearColor];
    
    NSArray *arr = _lmodel.firstKResults;
    if (arr.count >= 2) {
        ZYFModel *model = arr[0];
        ZYFModel *model2 = arr[1];
        _sLabel.text = model.title;
        _tLabel.text = model2.title;
    } else if (arr.count == 1) {
        ZYFModel *model = arr[0];
        _sLabel.text = _lmodel.firstTitle;
        _tLabel.text = model.title;
    } else if (!arr.count) {
        _sLabel.text = _lmodel.firstTitle;
        _tLabel.text = @"呵呵！";
    }
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
